package com.chixing.day17.MoreThread;

public class Producter implements Runnable{
    //生产者类、
    private Storage storage;
    public Producter(){

    }

    public Producter(Storage storage) {
        this.storage = storage;
    }

    @Override
    public void run() {
        while (true){
            try {
                Thread.sleep(1000);
                storage.produce();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
